package com.rstrulak.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.rstrulak.core.dao.GenericDaoImpl;
import com.rstrulak.model.Task;
import com.rstrulak.model.TaskAttachments;

@Repository("taskAttachmentsDao")
public class TaskAttachmentsDaoImpl extends GenericDaoImpl<TaskAttachments, Long> implements TaskAttachmentsDao {

	@Override
	public List<TaskAttachments> getTaskAttachemntsListByTask(Task task) {
		DetachedCriteria criteria = createDetachedCriteria();
		criteria.add(Restrictions.eq("task", task));
		return getListByCriteria(criteria);
	}

}
